Skip to content

feat(governance): New proposal type: CreateCanisterAndInstallCode.#9611

Merged
daniel-wong-dfinity-org merged 8 commits intomasterfrom
new-create-canister-proposal-type-daniel-wong
Apr 9, 2026
Merged

feat(governance): New proposal type: CreateCanisterAndInstallCode.#9611
daniel-wong-dfinity-org merged 8 commits intomasterfrom
new-create-canister-proposal-type-daniel-wong

Conversation

@daniel-wong-dfinity-org
Copy link
Copy Markdown
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Mar 26, 2026

This is behind a flag, which per usual, is off in production.

This includes changes to .did, .proto, as well as actual executable implementation, including validation.

Prior Work

This new proposal type overlaps a bit with the existing NnsCanisterInstall proposal type. This differs in a couple of key ways:

  1. The created canister can live in other subnets.
  2. The created canister is NOT designated as an NNS canister (in Registry).

Implementation

This is a direct proposal action. This is because we implement validation (which would require Decode if this were instead done as an NnsFunction).

This follows the usual pattern of adding a new .rs file to the proposals dir, dedicated to the new proposal type. Within that file we have various impl blocks for the new proposal type, including impls for various traits.

Calls a new method of the Root canister, aptly named create_canister_and_install_code. See "References". As usual, Root does the real work.

Un-nested CanisterSettings from within UpdateCanisterSettings so that it can be shared with CreateCanisterAndInstallCode.

A large chunk of the changes here are mechanical type conversions.

Testing

Not yet tested, but since this is behind a flag, it should be fine for this code to be deployed (and in the master branch).

References

👈 Previous PR | Next PR 👉

github-actions[bot]

This comment was marked as resolved.

@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the create_canister_and_install_code-root-daniel-wong branch from 9ab868c to c70888a Compare April 7, 2026 14:58
github-merge-queue bot pushed a commit that referenced this pull request Apr 7, 2026
Only callable by governance.

As usual, this does the "real work" of a new upcoming proposal type that
creates a new canister in a non-NNS subnet (and install code into the
new canister).

# Prior Work

This new proposal type overlaps a bit with the existing
`NnsCanisterInstall` proposal type. This differs in a couple of key
ways:

1. The created canister can live in other subnets.
2. The created canister is NOT designated as an NNS canister (in
Registry).

# Behavior Details

This uses bounded wait so that NNS (Root and Governance canisters) does
not get stuck as a result of an unresponsive subnet (either because it
is malicious, or otherwise messed up).

The canister is created using cycles from the Root canister's balance.
This is like how when SNS-WASM creates canisters, cycles are taken from
its own balance. Keeping Root topped up is beyond the scope of this
feature.

# Testing

No tests yet. Those will be in a future PR. This is ok, because only
Governance is allowed to call this new method, and no code path in
Governance calls it yet.

# References

[Next PR 👉][next]

[next]: #9611
Base automatically changed from create_canister_and_install_code-root-daniel-wong to master April 7, 2026 15:50
…possibly in a non-NNS subnet. No actual impl yet. That's next (sson)...
…ernance side. Calling Root's create_canister_and_install_code method has been stubbed out. Root's method will be implemented next...
@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the new-create-canister-proposal-type-daniel-wong branch from 1e68d21 to 49e8481 Compare April 7, 2026 17:43
@daniel-wong-dfinity-org daniel-wong-dfinity-org dismissed github-actions[bot]’s stale review April 7, 2026 17:46
  1. Behind flag.
  2. Messaged clients on Slack.
  3. Changed Proposal (add new Action). Existing proposals are fine.
  4. Asking...
@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the new-create-canister-proposal-type-daniel-wong branch from 0451e23 to eee7d09 Compare April 8, 2026 11:52
@daniel-wong-dfinity-org daniel-wong-dfinity-org added this pull request to the merge queue Apr 9, 2026
Merged via the queue into master with commit 1a6e2be Apr 9, 2026
37 checks passed
@daniel-wong-dfinity-org daniel-wong-dfinity-org deleted the new-create-canister-proposal-type-daniel-wong branch April 9, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants